/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Presentacion;

import AccesoADatos.GlobalException;
import AccesoADatos.NoDataException;
import AccesoADatos.ServicioPermisoTableSpace;
import Logica.Clasificacion;
import Logica.Columna;
import Logica.Tabla;
import static java.awt.image.ImageObserver.WIDTH;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.RowFilter;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;

/**
 *
 * @author LiN
 */
public class PermisosTableSpace extends javax.swing.JPanel {
    private ServicioPermisoTableSpace serTS;
    private TableRowSorter<TableModel> sorter;
    private Clasificacion clasificacion;
    private JFrame frame;
    Conectado conectado;
    Catalogo catalogo;
    ArrayList<Tabla> tablas;
    
    String user;
    String pass;
    String ip;
    String port;
    String db;
    
    public PermisosTableSpace(Clasificacion clasificacion,JFrame frame,Conectado c, Catalogo cat) {
        initComponents();
        catalogo = cat;
        conectado = c;
        this.clasificacion=clasificacion;
        this.frame=frame;
        this.classL.setText(clasificacion.getClasificacion());
        sorter=new TableRowSorter<TableModel>(this.tablaTablas.getModel());
        this.tablaTablas.setRowSorter(sorter);   
        
        tablas = new ArrayList();
        try {
            cargarTablas();
        } catch (GlobalException | NoDataException ex) {
            JOptionPane.showMessageDialog(this, "Cannot load tables", "Warning", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(PermisosTableSpace.class.getName()).log(Level.SEVERE, null, ex);
        }
        cargarTablaDeTablas();
    }
    
    public void setConection(String user,String pass,String ip,String port,String db){
        this.user=user;
        this.pass=pass;
        this.ip=ip;
        this.port=port;
        this.db=db;
    }
    
    private void cargarTablaDeTablas() {
        for (int i = 0; i < ((DefaultTableModel) tablaTablas.getModel()).getRowCount();) {
            ((DefaultTableModel) tablaTablas.getModel()).removeRow(i);
        }

        //agrega lo que haya en el arraylist
        for (int i = 0; i < tablas.size(); i++) {
            Tabla r = tablas.get(i);
            ((DefaultTableModel) tablaTablas.getModel()).addRow(new Object[]{r.getNombre(),r.isInsert(),r.isDelete(),r.isAlter(),r.isSelect()});
        }
    }
    private void cargarTablaDeColumnas(int index) {
        for (int i = 0; i < ((DefaultTableModel) tablaColumnas.getModel()).getRowCount();) {
            ((DefaultTableModel) tablaColumnas.getModel()).removeRow(i);
        }

        //agrega lo que haya en el arraylist
        for (int i = 0; i < tablas.get(index).getColumans().size(); i++) {
            Columna r = tablas.get(index).getColumans().get(i);
            ((DefaultTableModel) tablaColumnas.getModel()).addRow(new Object[]{r.getNombre(),r.isInsert(),r.isUpdate()});
        }
    }
  
    private void cargarTablas() throws GlobalException, NoDataException {
        
        ServicioPermisoTableSpace su = new ServicioPermisoTableSpace(conectado.getConexion().user, conectado.getConexion().pass, conectado.getConexion().ip, conectado.getConexion().port, conectado.getConexion().db);
        ArrayList<String> tabs = (ArrayList<String>) su.listarTablas();
        
        for (int i = 0; i < tabs.size(); i+=2) {
            Tabla t = new Tabla(tabs.get(i),tabs.get(i+1),null,false,false, false, false);
            boolean encontro = false;
            for(int j=0;j<clasificacion.getTablaPermisos().size();j++){
                if(clasificacion.getTablaPermisos().get(j).getNombre().equals(t.getNombre())){
                    tablas.add(clasificacion.getTablaPermisos().get(j));
                    encontro = true;
                }
            }
            if(!encontro){
                tablas.add(t);
            }
            
        }
    }
    
    private void cargarColumnas(String nomTabla)throws GlobalException, NoDataException{
        ServicioPermisoTableSpace s = new ServicioPermisoTableSpace(conectado.getConexion().user, conectado.getConexion().pass, conectado.getConexion().ip, conectado.getConexion().port, conectado.getConexion().db);


        ArrayList<String> cols = (ArrayList<String>) s.listarColumnas(nomTabla);
        System.out.println(cols.toString());
        ArrayList<Columna> columnas = new ArrayList();
        
        for (int j = 0; j < cols.size(); j++) {
            columnas.add(new Columna(cols.get(j), false, false));
        }

        int index;
        for (index = 0; index < tablas.size(); index++) {
            if (tablas.get(index).getNombre().equals(nomTabla)) {
                
                for(int j=0;j<clasificacion.getTablaPermisos().size();j++){
                    if(clasificacion.getTablaPermisos().get(j).getNombre().equals(tablas.get(index).getNombre())){
//                        columnas = clasificacion.getTablaPermisos().get(j).getColumans();
                       
                        for(int k=0;k<clasificacion.getTablaPermisos().get(j).getColumans().size();k++){
                            for(int g=0;g<clasificacion.getTablaPermisos().get(j).getColumans().size();g++){
                                if(clasificacion.getTablaPermisos().get(j).getColumans().get(k).getNombre().equals(columnas.get(g).getNombre())){
                                    columnas.set(g,clasificacion.getTablaPermisos().get(j).getColumans().get(k));
                                    break;
                                }
                            }
                        }
                    }
                }
                tablas.get(index).setColumans(columnas);
                break;
            }
        }
    
        
        cargarTablaDeColumnas(index);
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        tablaTablas = new javax.swing.JTable();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tablaColumnas = new javax.swing.JTable();
        jTextField1 = new javax.swing.JTextField();
        saveButton = new javax.swing.JButton();
        cancelButton = new javax.swing.JButton();
        tableN = new javax.swing.JLabel();
        classL = new javax.swing.JLabel();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();

        tablaTablas.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Tables", "Insert", "Delete", "Select"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Object.class, java.lang.Boolean.class, java.lang.Boolean.class, java.lang.Boolean.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        tablaTablas.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tablaTablasMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(tablaTablas);

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        jLabel1.setText("Clasification: ");

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel2.setText("Table:");

        tablaColumnas.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Column", "Insert(Column)", "Update"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.Boolean.class, java.lang.Boolean.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        tablaColumnas.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tablaColumnasMouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(tablaColumnas);

        jTextField1.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextField1KeyReleased(evt);
            }
        });

        saveButton.setText("Save");
        saveButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saveButtonActionPerformed(evt);
            }
        });

        cancelButton.setText("Exit");
        cancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelButtonActionPerformed(evt);
            }
        });

        tableN.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        tableN.setText("Unknown");

        classL.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        classL.setText("Unknown");

        jButton4.setText("Insert All");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jButton5.setText("Update All");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        jButton6.setText("Select All");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        jButton1.setText("Filter");

        jLabel5.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel5.setText("Table Selection");

        jLabel6.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel6.setText("Columns Privilege");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(classL)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel2)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(tableN))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(saveButton, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(cancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addGroup(layout.createSequentialGroup()
                                    .addComponent(jTextField1)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 445, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 445, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.LEADING)))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jButton6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                            .addComponent(jLabel6))
                        .addGap(0, 69, Short.MAX_VALUE))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(classL))
                .addGap(18, 18, 18)
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(tableN))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jButton4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton5)
                        .addGap(8, 8, 8)
                        .addComponent(jButton6)))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(cancelButton)
                    .addComponent(saveButton))
                .addContainerGap(34, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
        this.frame.setVisible(false);
    }//GEN-LAST:event_cancelButtonActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        for(int i=0;i<tablaColumnas.getRowCount();i++){
             tablaColumnas.getModel().setValueAt(true, i, 1);
        }
       
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        for(int i=0;i<tablaColumnas.getRowCount();i++){
             tablaColumnas.getModel().setValueAt(true, i, 1);
             tablaColumnas.getModel().setValueAt(true, i, 2);
        }
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jTextField1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField1KeyReleased
        String text=this.jTextField1.getText();
        if (text.length() == 0) {
            sorter.setRowFilter(null);
        } else {
            sorter.setRowFilter(RowFilter.regexFilter(text.toUpperCase()));
        }
    }//GEN-LAST:event_jTextField1KeyReleased

    private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveButtonActionPerformed
        int rowTablas = tablaTablas.getSelectedRow();
        String nomTabla =((DefaultTableModel) tablaTablas.getModel()).getValueAt(rowTablas, 0)+"";
        boolean insert=(boolean) ((DefaultTableModel) tablaTablas.getModel()).getValueAt(rowTablas, 1);
        boolean delete= (boolean)((DefaultTableModel) tablaTablas.getModel()).getValueAt(rowTablas, 2);
        boolean select=(boolean) ((DefaultTableModel) tablaTablas.getModel()).getValueAt(rowTablas, 3);
        
        Tabla tabla=null;
        for(int i=0;i<tablas.size();i++){
            if(tablas.get(i).getNombre().equals(nomTabla)){
                tabla = tablas.get(i);
            }
        }
//        tabla.setAlter(alter);
        tabla.setDelete(delete);
        tabla.setInsert(insert);
        tabla.setSelect(select);
        
        //SQL GRANT
        serTS=new ServicioPermisoTableSpace(user,pass,ip,port,db);
        
        try {
            serTS.dropRole(clasificacion.getClasificacion());
            serTS.createRole(clasificacion.getClasificacion());
            serTS.grantPrivilege("connect", clasificacion.getClasificacion());
            serTS.grantPrivilege("resource", clasificacion.getClasificacion());
        } catch (SQLException | ClassNotFoundException ex) {
            Logger.getLogger(PermisosTableSpace.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        
        if(tabla.isInsert()){        
            try {
                serTS.grantPrivilegeT("insert", tabla.getNombre(),clasificacion.getClasificacion());
            } catch (SQLException | ClassNotFoundException ex) {
                Logger.getLogger(PermisosTableSpace.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        if(tabla.isAlter()){        
            try {
                serTS.grantPrivilegeT("alter", tabla.getNombre(),clasificacion.getClasificacion());
            } catch (SQLException | ClassNotFoundException ex) {
                Logger.getLogger(PermisosTableSpace.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        if(tabla.isDelete()){        
            try {
                serTS.grantPrivilegeT("delete", tabla.getNombre(),clasificacion.getClasificacion());
            } catch (SQLException | ClassNotFoundException ex) {
                Logger.getLogger(PermisosTableSpace.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        if(tabla.isSelect()){        
            try {
                serTS.grantPrivilegeT("select", tabla.getNombre(),clasificacion.getClasificacion());
            } catch (SQLException | ClassNotFoundException ex) {
                Logger.getLogger(PermisosTableSpace.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        //
        
        for(int i=0;i<tabla.getColumans().size();i++){
            boolean insertC= (boolean)((DefaultTableModel) tablaColumnas.getModel()).getValueAt(i, 1);
            boolean updateC=(boolean) ((DefaultTableModel) tablaColumnas.getModel()).getValueAt(i, 2);
            if(insertC || updateC){
                tabla.getColumans().get(i).setInsert(insertC);
                tabla.getColumans().get(i).setUpdate(updateC);
                
                if(insertC){
                    try {
                        serTS.grantPrivilegeC("insert", tabla.getNombre(), tabla.getColumans().get(i).getNombre(), clasificacion.getClasificacion());
                    } catch (            SQLException | ClassNotFoundException ex) {
                        Logger.getLogger(PermisosTableSpace.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
                if(updateC){
                    try {
                        serTS.grantPrivilegeC("update", tabla.getNombre(), tabla.getColumans().get(i).getNombre(), clasificacion.getClasificacion());
                    } catch (            SQLException | ClassNotFoundException ex) {
                        Logger.getLogger(PermisosTableSpace.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
                
            }
            else{
                tabla.getColumans().remove(i);
                i--;
            }
            
        }
        
        for(int i=0;i<clasificacion.getTablaPermisos().size();i++){
            if(clasificacion.getTablaPermisos().get(i).getNombre().equals(tabla.getNombre())){
                clasificacion.getTablaPermisos().remove(i);
            }
        }
        if(tabla.isAlter()||tabla.isDelete()||tabla.isInsert()||tabla.isSelect()||tabla.getColumans().size()>0){
            clasificacion.getTablaPermisos().add(tabla);
        }
        
        
        catalogo.guardarArchivo();
    }//GEN-LAST:event_saveButtonActionPerformed

    private void tablaColumnasMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tablaColumnasMouseClicked
             
      
    }//GEN-LAST:event_tablaColumnasMouseClicked

    private void tablaTablasMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tablaTablasMouseClicked
        JTable t = (JTable)evt.getSource();
        int row = t.getSelectedRow();
        if (row != -1) {
            String nomTabla=(String) tablaTablas.getModel().getValueAt(row,0);
            tableN.setText(nomTabla);
            System.out.println(nomTabla);
            try {
                cargarColumnas(nomTabla);
            } catch (GlobalException | NoDataException ex) {
                JOptionPane.showMessageDialog(this, "Cannot load" + nomTabla + "'s columns", "Warning", JOptionPane.ERROR_MESSAGE);
                //Logger.getLogger(PermisosTableSpace.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }//GEN-LAST:event_tablaTablasMouseClicked

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        for(int i=0;i<tablaColumnas.getRowCount();i++){
             tablaColumnas.getModel().setValueAt(true, i, 2);
        }
    }//GEN-LAST:event_jButton5ActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton cancelButton;
    private javax.swing.JLabel classL;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JButton saveButton;
    private javax.swing.JTable tablaColumnas;
    private javax.swing.JTable tablaTablas;
    private javax.swing.JLabel tableN;
    // End of variables declaration//GEN-END:variables
}
